using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Utils;
namespace Utils.WebFramework
{
    public class Resource : NameValues
    {
        internal Resource()
        {

        }
       
        public string Language
        {
            get { return language; }
        }

        public string OriginalLanguage
        {
            get { return originalLanguage; }
        }

        public bool CheckLanuage(string language)
        {
            return string.IsNullOrEmpty(language) || GetSupportLanguage(language) == this.language;
        }

        internal static string GetSupportLanguage(string langauge)
        {
            switch (langauge)
            {
                case "af"://Afrikaans 
                case "sq"://Albanian 
                case "ar-sa"://Arabic (Saudi Arabia) 
                case "ar-iq"://Arabic (Iraq) 
                case "ar-eg"://Arabic (Egypt) 
                case "ar-ly"://Arabic (Libya) 
                case "ar-dz"://Arabic (Algeria) 
                case "ar-ma"://Arabic (Morocco) 
                case "ar-tn"://Arabic (Tunisia) 
                case "ar-om"://Arabic (Oman) 
                case "ar-ye"://Arabic (Yemen) 
                case "ar-sy"://Arabic (Syria) 
                case "ar-jo"://Arabic (Jordan) 
                case "ar-lb"://Arabic (Lebanon) 
                case "ar-kw"://Arabic (Kuwait) 
                case "ar-ae"://Arabic (U.A.E.) 
                case "ar-bh"://Arabic (Bahrain) 
                case "ar-qa"://Arabic (Qatar) 
                case "eu"://Basque 
                case "bg"://Bulgarian 
                case "be"://Belarusian 
                case "ca"://Catalan 
                    langauge = "en";
                    break;
                case "zh-tw"://Chinese (Taiwan)
                    langauge = "zh-hk";
                    break;
                case "zh":
                case "zh-cn"://Chinese (PRC) 
                    langauge = "zh-cn";
                    break;
                case "zh-hk"://Chinese (Hong Kong SAR) 
                    langauge = "zh-hk";
                    break;
                case "zh-sg"://Chinese (Singapore) 
                    langauge = "en";
                    break;
                case "hr"://Croatian 
                case "cs"://Czech 
                case "da"://Danish 
                case "nl"://Dutch (Standard) 
                case "nl-be"://Dutch (Belgium) 
                case "en"://English 
                case "en-us"://English (United States) 
                case "en-gb"://English (United Kingdom) 
                case "en-au"://English (Australia) 
                case "en-ca"://English (Canada) 
                case "en-nz"://English (New Zealand) 
                case "en-ie"://English (Ireland) 
                case "en-za"://English (South Africa) 
                case "en-jm"://English (Jamaica) 
                //case "en"://English (Caribbean) 
                case "en-bz"://English (Belize) 
                case "en-tt"://English (Trinidad) 
                case "et"://Estonian 
                case "fo"://Faeroese 
                case "fa"://Farsi 
                case "fi"://Finnish 
                case "fr"://French (Standard) 
                case "fr-be"://French (Belgium) 
                case "fr-ca"://French (Canada) 
                case "fr-ch"://French (Switzerland) 
                case "fr-lu"://French (Luxembourg) 
                case "gd"://Gaelic (Scotland) 
                case "ga"://Irish 
                case "de"://German (Standard) 
                case "de-ch"://German (Switzerland) 
                case "de-at"://German (Austria) 
                case "de-lu"://German (Luxembourg) 
                case "de-li"://German (Liechtenstein) 
                case "el"://Greek 
                case "he"://Hebrew 
                case "hi"://Hindi 
                case "hu"://Hungarian 
                case "is"://Icelandic 
                case "id"://Indonesian 
                case "it"://Italian (Standard) 
                case "it-ch"://Italian (Switzerland) 
                case "ja"://Japanese 
                case "ko"://Korean 
                //case "ko"://Korean (Johab) 
                case "lv"://Latvian 
                case "lt"://Lithuanian 
                case "mk"://Macedonian (FYROM)
                case "ms"://Malaysian 
                case "mt"://Maltese 
                case "no"://Norwegian (Bokmal) 
                //case "no"://Norwegian (Nynorsk) 
                case "pl"://Polish 
                case "pt-br"://Portuguese (Brazil) 
                case "pt"://Portuguese (Portugal) 
                case "rm"://Rhaeto-Romanic 
                case "ro"://Romanian 
                case "ro-mo"://Romanian (Republic of Moldova) 
                case "ru"://Russian 
                case "ru-mo"://Russian (Republic of Moldova) 
                case "sz"://Sami (Lappish) 
                case "sr"://Serbian (Cyrillic) 
                //case "sr"://Serbian (Latin) 
                case "sk"://Slovak 
                case "sl"://Slovenian 
                case "sb"://Sorbian 
                case "es"://Spanish (Spain) 
                case "es-mx"://Spanish (Mexico) 
                case "es-gt"://Spanish (Guatemala) 
                case "es-cr"://Spanish (Costa Rica) 
                case "es-pa"://Spanish (Panama) 
                case "es-do"://Spanish (Dominican Republic) 
                case "es-ve"://Spanish (Venezuela) 
                case "es-co"://Spanish (Colombia) 
                case "es-pe"://Spanish (Peru) 
                case "es-ar"://Spanish (Argentina) 
                case "es-ec"://Spanish (Ecuador) 
                case "es-cl"://Spanish (Chile) 
                case "es-uy"://Spanish (Uruguay) 
                case "es-py"://Spanish (Paraguay) 
                case "es-bo"://Spanish (Bolivia) 
                case "es-sv"://Spanish (El Salvador) 
                case "es-hn"://Spanish (Honduras) 
                case "es-ni"://Spanish (Nicaragua) 
                case "es-pr"://Spanish (Puerto Rico) 
                case "sx"://Sutu 
                case "sv"://Swedish 
                case "sv-fi"://Swedish (Finland) 
                case "th"://Thai 
                case "ts"://Tsonga 
                case "tn"://Tswana 
                case "tr"://Turkish 
                case "uk"://Ukrainian 
                case "ur"://Urdu 
                case "ve"://Venda 
                case "vi"://Vietnamese 
                case "xh"://Xhosa 
                case "ji"://Yiddish 
                case "zu"://Zulu 
                    langauge = "en";
                    break;
                default:
                    langauge = "en";
                    break;
            }

            return langauge;
        }

        internal string originalLanguage = string.Empty;
        internal string language         = string.Empty;
    }
}
